package com.example.springbootdemo.app.service.impl;

import com.example.springbootdemo.domin.VO.getCourseDetailVO;
import com.example.springbootdemo.domin.entity.Course;
import com.example.springbootdemo.domin.entity.Teacher;
import com.example.springbootdemo.infra.mapper.TeacherMapper;
import com.example.springbootdemo.app.service.TeacherService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherServiceImpl implements TeacherService {
    @Autowired
    private TeacherMapper teacherMapper;
    private Logger logger = LoggerFactory.getLogger(TeacherServiceImpl.class);

    @Override
    public Teacher getTeacher(Integer tno) {
        return teacherMapper.getTeacher(tno);
    }

    @Override
    public void updateTeacher(Teacher teacher) {
        teacherMapper.updateTeacher(teacher);
    }

    @Override
    public void deleteTeacher(Integer tno) {
        teacherMapper.deleteTeacher(tno);
    }

    @Override
    public void addTeacher(Teacher teacher) {
        teacherMapper.addTeacher(teacher);
    }

    @Override
    public void addTeachers(List<String> list) {
        teacherMapper.addTeachers(list);
    }

    @Override
    public List<Teacher> getTeachers(List<String> list) {
        return teacherMapper.getTeachers(list);
    }

    @Override
    public List<Teacher> getAll() {
        return teacherMapper.getAll();
    }

    @Override
    public List<getCourseDetailVO> getCourseByTno(String tname) {
        logger.info("方法getCourseByTno返回值：{}", teacherMapper.getCourseByTno(tname));
        return teacherMapper.getCourseByTno(tname);
    }


}
